#include "RTI_HAL_KA.h"

void vfnRTI_ClearFlag (void)
{
    SRTISC_RTIACK = 1;
}

uint8 u8RTI_CheckFlag (void)
{
    return SRTISC_RTIF;
}

void vfnRTI_EnableInterrupt (void)
{
    SRTISC_RTIE = 1;
}

void vfnRTI_DisableInterrupt (void)
{
    SRTISC_RTIE = 0;
}

void vfnRTI_DelaySelect (uint8 u8RTI_Period)
{
    SRTISC_RTIS = u8RTI_Period;
}

void vfnRTI_ClockSelect (uint8 u8RTI_Clock)
{
    SRTISC_RTICLKS = u8RTI_Clock;    
}

void vfnRTI_Init (void)
{
    vfnRTI_ClockSelect(RTI_CLK_INTERNAL);
    vfnRTI_EnableInterrupt();
    vfnRTI_DelaySelect(RTI_PERIOD_8MS);
}